<template>
	<view>
		<view class="title">问吧</view>
		<view class="weichat" @tap="dL">微信登录</view>
		<view class="user" @tap="user">账号登录</view>
	</view>
</template>

<script>
	import api from "@/common/api.js";
	import {
		baseURL
	} from "@/common/http.js";
	import app from "../../App.vue"
	export default {
		data() {
			return {

			};
		},
		methods: {
			dL() {
				uni.navigateTo({
					url: "../chatLogin/chatLogin"
				})
				/* uni.getStorage({
					key: 'message',
					success: () => {
						api.add({
							id: uni.getStorageSync('message')[0].id,
							fen: 1,
							api: 'wenfenzen',
							fenname: '登录'
						}).then(res => {
							console.log(res)
						}).catch(err => {
							console.log(err)
						})
						uni.reLaunch({
							url: '../index/index'
						})
					},
					fail: () => {
						uni.navigateTo({
							url: "../chatLogin/chatLogin"
						})
					}
				}) */
			},
			user() {
				uni.navigateTo({
					url: '../login/login'
				})
			}
		},
		onShareAppMessage(options) {
			let shareObj = {
				success: (res) => {
					if (res.errMsg == 'shareAppMessage:ok') {
						uni.showToast({
							title: '分享成功',
							icon: 'success',
							duration: 1500
						})
					}
				},
				fail: () => {
					if (res.errMsg == 'shareAppMessage:fail cancel') {
						uni.showToast({
							title: '取消分享',
							icon: 'none',
							duration: 2000
						})
					} else if (res.errMsg == 'shareAppMessage:fail') {
						// 转发失败，其中 detail message 为详细失败信息
					}
				},
				complete: () => {
					// 转发结束之后的回调（转发成不成功都会执行）
				}
			}
		},
	}
</script>

<style lang="scss">
	.title {
		width: 500rpx;
		height: 100rpx;
		line-height: 100rpx;
		font-size: 100rpx;
		font-weight: bold;
		margin: 100rpx auto 20%;
		text-align: center
	}

	.weichat {
		width: 600rpx;
		height: 100rpx;
		line-height: 100rpx;
		font-size: 32rpx;
		margin: 70% auto 10%;
		background: #209FFC;
		color: #fff;
		text-align: center;
		border-radius: 15rpx;
	}

	.user {
		width: 600rpx;
		height: 100rpx;
		line-height: 100rpx;
		font-size: 32rpx;
		margin: 100rpx auto;
		background: #209FFC;
		color: #fff;
		text-align: center;
		border-radius: 15rpx;
	}
</style>
